<?php

/**
 * Sistema form base class.
 *
 * @package    form
 * @subpackage sistema
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseSistemaForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_sistema'       => new sfWidgetFormInputHidden(),
      'id_sistema_pai'   => new sfWidgetFormDoctrineChoice(array('model' => 'Sistema', 'add_empty' => true)),
      'nm_sistema'       => new sfWidgetFormInput(),
      'ds_sobre'         => new sfWidgetFormTextarea(),
      'ds_servico'       => new sfWidgetFormTextarea(),
      'ds_contato'       => new sfWidgetFormTextarea(),
      'ds_marketing'     => new sfWidgetFormTextarea(),
      'ds_twitter'       => new sfWidgetFormInput(),
      'ds_facebook'      => new sfWidgetFormInput(),
      'ds_youtube'       => new sfWidgetFormInput(),
      'ds_flickr'        => new sfWidgetFormInput(),
      'ds_orkut'         => new sfWidgetFormInput(),
      'ds_institucional' => new sfWidgetFormTextarea(),
      'ds_publico'       => new sfWidgetFormTextarea(),
      'ds_destaque'      => new sfWidgetFormInput(),
    ));

    $this->setValidators(array(
      'id_sistema'       => new sfValidatorDoctrineChoice(array('model' => 'Sistema', 'column' => 'id_sistema', 'required' => false)),
      'id_sistema_pai'   => new sfValidatorDoctrineChoice(array('model' => 'Sistema', 'required' => false)),
      'nm_sistema'       => new sfValidatorString(array('max_length' => 200, 'required' => false)),
      'ds_sobre'         => new sfValidatorString(array('required' => false)),
      'ds_servico'       => new sfValidatorString(array('required' => false)),
      'ds_contato'       => new sfValidatorString(array('required' => false)),
      'ds_marketing'     => new sfValidatorString(array('required' => false)),
      'ds_twitter'       => new sfValidatorString(array('max_length' => 200, 'required' => false)),
      'ds_facebook'      => new sfValidatorString(array('max_length' => 200, 'required' => false)),
      'ds_youtube'       => new sfValidatorString(array('max_length' => 200, 'required' => false)),
      'ds_flickr'        => new sfValidatorString(array('max_length' => 200, 'required' => false)),
      'ds_orkut'         => new sfValidatorString(array('max_length' => 200, 'required' => false)),
      'ds_institucional' => new sfValidatorString(array('required' => false)),
      'ds_publico'       => new sfValidatorString(array('required' => false)),
      'ds_destaque'      => new sfValidatorString(array('max_length' => 140, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('sistema[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Sistema';
  }

}
